<template>
  <div class="app-container">
    <el-form :model="searchForm" :inline="true">
      <el-row>
        <el-col :span="24">
          <el-form-item prop="fuzzy">
            <el-input
              v-model="searchForm.fuzzy"
              style="width: 250px"
              placeholder="试剂/耗材名称/编号"
            />
          </el-form-item>
          <el-form-item prop="norms" label="试剂规格:">
            <el-select
              v-model="searchForm.norms"
              style="width: 145px"
              placeholder="请选择规格"
              clearable
            >
              <el-option
                v-for="item in norms"
                :key="item.id"
                :label="item.name"
                :value="item.name"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="state" label="试剂状态:">
            <el-select
              v-model="searchForm.state"
              style="width: 145px"
              placeholder="请选择状态"
              clearable
            >
              <el-option
                v-for="item in state"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>

          <el-form-item prop="type" label="试剂类别:">
            <el-select
              v-model="searchForm.type"
              style="width: 145px"
              placeholder="请选择类别"
              clearable
            >
              <el-option
                v-for="item in typeId"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>

          <el-form-item>
            <template>
              <el-button
                type="primary"
                class="iconfont icon-chaxun1"
                size="small"
                @click="handleSearch"
              >
                查询</el-button
              >
            </template>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>

    <div>
      <el-table
        ref="stockTable"
        stripe
        border
        :data="factorData"
        class="table-item"
        highlight-current-row
        :header-cell-style="{ background: '#ECF3FC' }"
        style="width: 100%"
      >
        <template slot="empty">
          <div class="table_empty">
            <div class="empty_tips">
              <span> 暂无数据 </span>
            </div>
          </div>
        </template>
        <el-table-column type="index" width="70" align="center" label="序号" />
        <el-table-column
          prop="code"
          label="试剂/耗材编号"
          width="180"
          align="center"
        />
        <el-table-column
          prop="name"
          label="试剂/耗材名称"
          width="180"
          align="center"
        />
        <el-table-column
          prop="type"
          label="试剂/耗材类别"
          width="180"
          align="center"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.type == '1'">一般化学试剂</span>
            <span v-if="scope.row.type == '2'">易制毒化学试剂</span>
            <span v-if="scope.row.type == '3'">易制爆化学试剂</span>
            <span v-if="scope.row.type == '4'">标准物质</span>
            <span v-if="scope.row.type == '5'">耗材</span>
          </template>
        </el-table-column>
        <el-table-column prop="model" label="型号" width="110px" align="center">
        </el-table-column>
        <el-table-column prop="norms" label="规格" width="130px" align="center">
        </el-table-column>
        <el-table-column prop="batch" label="批号" width="130" align="center" />
        <el-table-column
          prop="date"
          label="生产日期"
          width="180"
          align="center"
        />
        <el-table-column
          prop="validity"
          label="有效期"
          width="120"
          align="center"
        >
          <template slot-scope="scope">
            <span> {{ scope.row.validity }} {{ "个月" }}</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="expireDate"
          label="失效日期"
          width="100px"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="day"
          label="过期倒计时"
          width="140"
          align="center"
        >
          <template slot-scope="scope">
            <span :class="scope.row.day > 0 ? 'green' : 'red'">
              {{ scope.row.day }}{{ "天" }}</span
            >
          </template>
        </el-table-column>

        <el-table-column
          prop="day"
          label="供应品状态"
          width="180"
          align="center"
        >
          <template slot-scope="scope">
            <span
              v-if="scope.row.day > 0"
              style="background: #13CE66;padding: 20px;color: #fff;;"
              >有效</span
            >
            <span
              v-if="scope.row.day <= 0"
              style="background: #ff1100;padding: 20px;color: #fff;;"
              >失效</span
            >
          </template>
        </el-table-column>

        <el-table-column
          prop="surplus"
          label="剩余小包装数量"
          width="150"
          align="center"
        >
        </el-table-column>

        <el-table-column
          prop="remainTotal"
          label="剩余重量/体积"
          width="180"
          align="center"
        />

        <el-table-column
          prop="applyUser"
          label="申领人"
          width="180"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="createTime"
          label="申领时间"
          width="180"
          align="center"
        />

        <el-table-column
          prop="total"
          label="申领重量/体积"
          width="130"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="ample"
          label="库存状态"
          width="180"
          align="center"
        >
          <template slot-scope="scope">
            <span
              v-if="scope.row.ample == '1'"
              style="background: #13CE66;padding: 20px;color: #fff;;"
              >库存充足</span
            >
            <span
              v-if="scope.row.ample == '2'"
              style="background: #ff1100;padding: 20px;color: #fff;;"
              >库存不足</span
            >
          </template>
        </el-table-column>

        <el-table-column fixed="right" align="center" label="操作" width="180">
          <template slot-scope="scope">
            <el-button type="text" @click="View(scope.row)">查看</el-button>
            <div class="erc-divider-vertical" />
            <el-button type="text" @click="Instrument(scope.row)"
              >出库</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div style="">
      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="searchForm.pageNumber"
        :limit.sync="searchForm.pageSize"
        @pagination="handleSearch"
      />
    </div>
    <el-dialog
      title="试剂出库"
      :visible.sync="purchaseVisible"
      center
      top="5vh"
      width="800px"
    >
      <el-form
        :model="installForm"
        :rules="rules"
        ref="installForm"
        label-width="150px"
      >
        <el-row>
          <el-col :span="10">
            <el-form-item prop="" label="申领人:">
              <el-input
                v-model="claim"
                style="width:170px"
                :disabled="true"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item prop="drawId" label="领取人:" label-width="130px">
              <el-select
                v-model="installForm.drawId"
                placeholder="请选择"
                filterable
                clearable
                @change="handleCheckedCitiesUser"
                style="width:170px"
              >
                <el-option
                  v-for="item in usernameOptions"
                  :key="item.userId"
                  :label="item.empName"
                  :value="item.userId"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="10">
            <el-form-item prop="accompany" label="陪同人:">
              <!-- <el-input v-model="installForm.accompany" /> -->
              <el-select
                v-model="installForm.accompany"
                placeholder="请选择"
                filterable
                clearable
                @change="handleChecked"
                style="width:170px"
              >
                <el-option
                  v-for="item in usernameOptions"
                  :key="item.userId"
                  :label="item.empName"
                  :value="item.userId"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="预计返还日期:" prop="date" label-width="130px">
              <el-date-picker
                v-model="installForm.date"
                value-format="yyyy-MM-dd"
                type="date"
                style="width:170px"
              />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="10">
            <el-form-item prop="accompany" label="试剂申领重量/体积:"
              >{{ this.applyAmount }} {{ this.singleUnit }}
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item prop="accompany" label="试剂出库重量/体积:"
              >{{ this.installForm.amount }}{{ this.singleUnit }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="10">
            <el-form-item prop="ids" label="选择试剂:">
              <el-tree
                :data="factor"
                :props="defaultProps"
                @check="currentChecked"
                show-checkbox
                default-expand-all
                node-key="id"
                style="width:560px"
              >
                <div
                  style="width:100%;"
                  slot-scope="{ node, data }"
                  @click="showAlert(data, $event)"
                >
                  <span>
                    <div style="display: flex;">
                      <span style="margin-top: 14px;">{{ node.label }} </span>
                      <el-progress
                        style="width: 175px;height: 16px;top: 24px;left: 5px;"
                        :text-inside="true"
                        :stroke-width="15"
                        :stroke-height="15"
                        :percentage="node.data.surplus"
                        status="success"
                        color="#0C77FF"
                      ></el-progress>
                      <P style="margin-left: 10px;"
                        >(剩余&nbsp;{{ node.data.surplus }}&nbsp;{{
                          node.data.unit
                        }})</P
                      >
                    </div>
                  </span>
                </div>
              </el-tree>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="purchaseVisible = false">取消</el-button>
        <el-button type="primary" @click="Confirm">确认</el-button>
      </div>
    </el-dialog>

    <!-- 查看弹框 -->
    <el-dialog
      title="试剂耗材详情"
      :visible.sync="orderDialogView"
      center
      width="1400px"
    >
      <el-form ref="orderView" :model="orderView">
        <el-card shadow="never">
          <div slot="header">
            <span>试剂耗材剂基础信息<i class="el-input__icon"/></span>
          </div>

          <el-row>
            <el-col :span="8">
              <el-form-item prop="code" label="试剂编号:" label-width="130px">
                {{ this.orderView.code }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="name" label="试剂名称:" label-width="130px">
                {{ this.orderView.name }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="model" label="型号:" label-width="130px">
                {{ this.orderView.model }}
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="8">
              <el-form-item prop="norms" label="规格:" label-width="130px">
                {{ this.orderView.norms }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="batch" label="批号:" label-width="130px">
                {{ this.orderView.batch }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="date" label="生产日期:" label-width="130px">
                {{ this.orderView.date }}
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="8">
              <el-form-item prop="validity" label="有效期:" label-width="130px">
                {{ this.orderView.validity }} {{ "个月" }}
              </el-form-item>
            </el-col>

            <el-col :span="8">
              <el-form-item
                prop="expireDate"
                label="失效日期:"
                label-width="130px"
              >
                {{ this.orderView.expireDate }}
              </el-form-item>
            </el-col>

            <el-col :span="8">
              <el-form-item prop="day" label="过期倒计时:" label-width="130px">
                <template>
                  <span :class="this.orderView.day > 0 ? 'green' : 'red'">
                    {{ this.orderView.day }}{{ "天" }}</span
                  >
                </template>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="8">
              <el-form-item prop="day" label="供应品状态:" label-width="130px">
                <template>
                  <span
                    v-if="this.orderView.day > 0"
                    style="background: #13CE66;padding: 8px;color: #fff;;"
                    >有效</span
                  >
                  <span
                    v-if="this.orderView.day <= 0"
                    style="background: #ff1100;padding: 8px;color: #fff;"
                    >失效</span
                  >
                </template>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                prop="surplus"
                label="剩余小包装数量:"
                label-width="130px"
              >
                {{ this.orderView.surplus }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                prop="remainTotal"
                label="剩余重量/体积:"
                label-width="130px"
              >
                {{ this.orderView.remainTotal }}
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="8">
              <el-form-item
                prop="applyUser"
                label="申领人:"
                label-width="130px"
              >
                {{ this.orderView.applyUser }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                prop="createTime"
                label="申领时间:"
                label-width="130px"
              >
                {{ this.orderView.createTime }}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                prop="total"
                label="申领重量/体积:"
                label-width="130px"
              >
                {{ this.orderView.total }}
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="8">
              <el-form-item prop="ample" label="库存状态:" label-width="130px">
                <template>
                  <span
                    v-if="this.orderView.ample == '1'"
                    style="background: #13CE66;padding: 8px;color: #fff;;"
                    >库存充足</span
                  >
                  <span
                    v-if="this.orderView.ample == '2'"
                    style="background: #ff1100;padding: 8px;color: #fff;;"
                    >库存不足</span
                  >
                </template>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="orderDialogView = false">取消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import * as List from "@/api/List";
import * as reagentsGlance from "@/api/reagentsGlance";
import { getUser } from "@/api/system/user";
import { getLodop } from "@/utils/LodopFuncs";
import Pagination from "@/components/Pagination"; // Secondary package based on el-pagination

export default {
  components: {
    Pagination,
    getLodop,
    getUser
  },
  data() {
    return {
      searchForm: {
        pageNumber: 1,
        pageSize: 10
      },
      factorData: [],
      total: 0,
      orderDialogView: false,
      orderView: {
        reagentStorage: [],
        ableList: [],
        enAbleList: []
      },
      usernameOptions: [],
      purchaseVisible: false,
      installForm: {
        id: "",
        ids: [],
        drawId: "",
        accompany: "",
        date: "",
        amount: ""
      },
      applyAmount: "",
      singleUnit: "",
      claim: "",
      factor: [],
      defaultProps: {
        children: "reagentSubs",
        label: "code",
        disabled: this.disabledFn
      },
      norms: [
        {
          name: "基准试剂(PT)",
          id: 1
        },
        {
          name: "优级纯(GR)",
          id: 2
        },
        {
          name: "分析纯(AR)",
          id: 3
        },
        {
          name: "化学纯(CP)",
          id: 4
        }
      ],
      state: [
        {
          name: "待入库",
          id: 1
        },
        {
          name: "有效",
          id: 2
        },
        {
          name: "降級",
          id: 3
        },
        {
          name: "失效",
          id: 4
        },
        {
          name: "已用完",
          id: 5
        },
        {
          name: "报废",
          id: 6
        }
      ],
      typeId: [
        {
          name: "一般化学试剂",
          id: 1
        },
        {
          name: "易制毒化学试剂",
          id: 2
        },
        {
          name: "易制爆化学试剂",
          id: 3
        },
        {
          name: "标准物质",
          id: 4
        },
        {
          name: "耗材",
          id: 5
        }
      ],
      // 表单校验
      rules: {
        name: [
          { required: true, message: "试剂名称不能为空", trigger: "blur" }
        ],
        model: [{ required: true, message: "型号不能为空", trigger: "blur" }],
        norms: [{ required: true, message: "规格不能为空", trigger: "blur" }],
        date: [{ required: true, message: "日期不能为空", trigger: "blur" }],
        validity: [
          { required: true, message: "有效期不能为空", trigger: "blur" }
        ],
        singleUnit: [
          { required: true, message: "基本计量单位不能为空", trigger: "blur" }
        ],
        singleSize: [
          {
            required: true,
            message: "基本重量/体积/数量不能为空",
            trigger: "blur"
          }
        ],
        price: [
          { required: true, message: "采购单价(元)不能为空", trigger: "blur" }
        ],
        amount: [
          {
            required: true,
            message: "预计使用重量/体积不能为空",
            trigger: "blur"
          }
        ],
        ids: [
          {
            required: true,
            message: "选择试剂不能为空",
            trigger: "blur"
          }
        ]
      }
    };
  },
  created() {
    this.handleSearch();
  },
  methods: {
    handleSearch() {
      reagentsGlance.applyList(this.searchForm).then(res => {
        //console.log(res);
        if (res.code === 200) {
          this.factorData = res.result.records || [];
          this.total = res.result.total;
          //console.log(this.total);
          //console.log(this.factorData);
        }
      });
      //领取人
      List.userList().then(res => {
        this.usernameOptions = res.result;
      });
    },

    //申请出库
    Instrument(row) {
      //console.log(row);
      this.installForm.id = row.id;
      this.applyAmount = row.applyAmount;
      this.singleUnit = row.singleUnit;
      this.installForm.amount=""
      reagentsGlance.detail({ id: row.reagentId }).then(res => {
        //console.log(res);
        if (res.code === 200) {
          this.factor = res.result.bigSubVos || [];
          //console.log(this.factor);
        }
      });
      getUser(this.$store.getters.userInfo.userId).then(response => {
        this.claim = response.result.user.empName;
      });
      this.purchaseVisible = true;
    },

    currentChecked(nodeObj, SelectedObj) {
      let arr = [],
        arr1 = [];
      arr = SelectedObj.checkedKeys.filter(item => item !== undefined);
      this.installForm.ids = arr;

      for (var item of SelectedObj.checkedNodes) {
        arr1.push(item.surplus);
        console.log(arr1);
        this.installForm.amount = arr1[0];
      }
    },
    //禁用
    disabledFn(data, node) {
      // //console.log("disabled函数: ", data, node);
      if (data.surplus == 0) {
        // 根据节点数据条件设置判断，
        return true;
      } else {
        return false;
      }
    },
    //选择领取人
    handleCheckedCitiesUser(e) {
      this.installForm.drawId = e;
      //console.log(this.installForm.drawId);
    },
    //选择陪同人
    handleChecked(e) {
      this.installForm.accompany = e;
      //console.log(this.installForm.accompany);
    },
    //试剂出库
    Confirm() {
      reagentsGlance.activeOutbound(this.installForm).then(res => {
        if (res.code === 200) {
          //console.log(res);
          this.$notify({
            title: "成功",
            message: res.message,
            type: "success"
          });
          this.handleSearch();
          this.purchaseVisible = false;
        } else {
          this.$notify({
            title: "失败",
            message: res.message,
            type: "error"
          });
        }
      });
    },

    //查看
    View(row) {
      this.orderDialogView = true;
      this.orderView = row;
    }
  }
};
</script>

<style lang="scss" scoped>
.search_div {
  > div {
    &:nth-child(1) {
      margin-right: 10px;
    }
    display: inline-block;
  }
}

.search_input {
  width: 200px;
  margin-bottom: 5px;
}
.search-right {
  text-align: right;
  padding-right: 25px;
}
.item {
  font-size: 16px;
}
::v-deep .el-card .el-card__header {
  padding: 5px 20px;
  background: #f3f2f2;
}
.block-flex {
  position: relative;
  display: flex;
  & > div {
    border: 1px solid #b7b7b7;
    width: 100px;
    margin: 0;
    line-height: 30px;
    text-align: center;
  }
  & > div:first-child {
    background: #b7b7b7;
  }
}
.card-left {
  width: 100%;
  min-height: 200px;
  max-height: 450px;
}
.card-right {
  width: 100%;
  min-height: 200px;
  max-height: 450px;
}
.el-card {
  overflow: auto;
}
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
.el-icon-arrow-down {
  font-size: 14px;
}
// /deep/.main-body .el-table__header-wrapper  .el-checkbox{
//   display:none
// }
.agreement_picture {
  min-height: calc(100%);
  .pdf {
    height: calc(100%);
  }
}

/deep/ .el-input.is-disabled .el-input__inner {
  color: unset;
}

/deep/.i-input .el-input__inner {
  text-align: center;
}
/deep/.right-input .el-input__inner {
  text-align: right;
}

.el-header {
  line-height: 45px;
  height: 45px;
}
.el-footer {
  text-align: right;
  line-height: 45px;
  height: 45px;

  .pagination-container {
    padding: 0;
    margin-top: 10px;
    margin-bottom: 45px;
  }
}
.el-main {
  overflow-y: auto;
}
.el-container {
  max-height: 450px;
}

.text {
  font-size: 14px;
}
.dialog-item {
  padding-left: 3px;
  line-height: 30px;
  cursor: pointer;
}
.dialog-item:hover {
  background: #e8f4ff;
  border-radius: 3px;
}

table {
  background-color: transparent;
}

caption {
  padding-top: 8px;
  padding-bottom: 8px;
  color: #777;
  text-align: left;
}

th {
  text-align: left;
}

.table {
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
}

.table > tbody > tr > td,
.table > tbody > tr > th,
.table > tfoot > tr > td,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > thead > tr > th {
  padding: 8px;
  line-height: 1.42857143;
  vertical-align: middle;
  border-top: 1px solid #ddd;
}

.table > thead > tr > th {
  vertical-align: bottom;
  border-bottom: 2px solid #ddd;
}

.table > caption + thead > tr:first-child > td,
.table > caption + thead > tr:first-child > th,
.table > colgroup + thead > tr:first-child > td,
.table > colgroup + thead > tr:first-child > th,
.table > thead:first-child > tr:first-child > td,
.table > thead:first-child > tr:first-child > th {
  border-left: 1px solid #f1f2f4;
}

.table > tbody + tbody {
  border-top: 2px solid #ddd;
}

.table .table {
  background-color: #ffffff;
}

.table-condensed > tbody > tr > td,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > td,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > thead > tr > th {
  padding: 5px;
}

.table-bordered {
  border: 1px solid #ddd;
}

.table-bordered > tbody > tr > td,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > td,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > thead > tr > th {
  border: 1px solid #ddd;
}

.table-bordered > thead > tr > td,
.table-bordered > thead > tr > th {
  border-bottom-width: 2px;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #f9f9f9;
}

.table-hover > tbody > tr:hover {
  background-color: #f5f5f5;
}

table col[class*="col-"] {
  position: static;
  display: table-column;
  float: none;
}

table td[class*="col-"],
table th[class*="col-"] {
  position: static;
  display: table-cell;
  float: none;
}

.table > tbody > tr.active > td,
.table > tbody > tr.active > th,
.table > tbody > tr > td.active,
.table > tbody > tr > th.active,
.table > tfoot > tr.active > td,
.table > tfoot > tr.active > th,
.table > tfoot > tr > td.active,
.table > tfoot > tr > th.active,
.table > thead > tr.active > td,
.table > thead > tr.active > th,
.table > thead > tr > td.active,
.table > thead > tr > th.active {
  background-color: #f5f5f5;
}

.table-hover > tbody > tr.active:hover > td,
.table-hover > tbody > tr.active:hover > th,
.table-hover > tbody > tr:hover > .active,
.table-hover > tbody > tr > td.active:hover,
.table-hover > tbody > tr > th.active:hover {
  background-color: #e8e8e8;
}

.table > tbody > tr.success > td,
.table > tbody > tr.success > th,
.table > tbody > tr > td.success,
.table > tbody > tr > th.success,
.table > tfoot > tr.success > td,
.table > tfoot > tr.success > th,
.table > tfoot > tr > td.success,
.table > tfoot > tr > th.success,
.table > thead > tr.success > td,
.table > thead > tr.success > th,
.table > thead > tr > td.success,
.table > thead > tr > th.success {
  background-color: #dff0d8;
}

.table-hover > tbody > tr.success:hover > td,
.table-hover > tbody > tr.success:hover > th,
.table-hover > tbody > tr:hover > .success,
.table-hover > tbody > tr > td.success:hover,
.table-hover > tbody > tr > th.success:hover {
  background-color: #d0e9c6;
}

.table > tbody > tr.info > td,
.table > tbody > tr.info > th,
.table > tbody > tr > td.info,
.table > tbody > tr > th.info,
.table > tfoot > tr.info > td,
.table > tfoot > tr.info > th,
.table > tfoot > tr > td.info,
.table > tfoot > tr > th.info,
.table > thead > tr.info > td,
.table > thead > tr.info > th,
.table > thead > tr > td.info,
.table > thead > tr > th.info {
  background-color: #d9edf7;
}

.table-hover > tbody > tr.info:hover > td,
.table-hover > tbody > tr.info:hover > th,
.table-hover > tbody > tr:hover > .info,
.table-hover > tbody > tr > td.info:hover,
.table-hover > tbody > tr > th.info:hover {
  background-color: #c4e3f3;
}

.table > tbody > tr.warning > td,
.table > tbody > tr.warning > th,
.table > tbody > tr > td.warning,
.table > tbody > tr > th.warning,
.table > tfoot > tr.warning > td,
.table > tfoot > tr.warning > th,
.table > tfoot > tr > td.warning,
.table > tfoot > tr > th.warning,
.table > thead > tr.warning > td,
.table > thead > tr.warning > th,
.table > thead > tr > td.warning,
.table > thead > tr > th.warning {
  background-color: #fcf8e3;
}

.table-hover > tbody > tr.warning:hover > td,
.table-hover > tbody > tr.warning:hover > th,
.table-hover > tbody > tr:hover > .warning,
.table-hover > tbody > tr > td.warning:hover,
.table-hover > tbody > tr > th.warning:hover {
  background-color: #faf2cc;
}

.table > tbody > tr.danger > td,
.table > tbody > tr.danger > th,
.table > tbody > tr > td.danger,
.table > tbody > tr > th.danger,
.table > tfoot > tr.danger > td,
.table > tfoot > tr.danger > th,
.table > tfoot > tr > td.danger,
.table > tfoot > tr > th.danger,
.table > thead > tr.danger > td,
.table > thead > tr.danger > th,
.table > thead > tr > td.danger,
.table > thead > tr > th.danger {
  background-color: #f2dede;
}

.table-hover > tbody > tr.danger:hover > td,
.table-hover > tbody > tr.danger:hover > th,
.table-hover > tbody > tr:hover > .danger,
.table-hover > tbody > tr > td.danger:hover,
.table-hover > tbody > tr > th.danger:hover {
  background-color: #ebcccc;
}

.table-responsive {
  min-height: 3.01%;
  overflow-x: auto;
}

.table-bordered,
.table-bordered > tbody > tr > td,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > td,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > thead > tr > th {
  border: 1px solid #e9ecef;
  text-align: center;
  line-height: 14px;
}

.table-bordered,
td,
th {
  border-radius: 0 !important;
}

.table-bordered > tbody > tr:last-child > td {
  border-bottom: 1px solid #e9ecef;
}

.bootstrap-table .fixed-table-container .fixed-table-header {
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
}

.fixed-table-header .table > thead > tr {
  background: none !important;
}

.table > thead > tr {
  color: #636363;
  font-weight: 400;
  background: rgba(0, 0, 0, 0.05);
  /*   background: repeat-x #fafafa;
  background-image: -webkit-linear-gradient(top,#F8F8F8 0,#fafafa 100%);
  background-image: -o-linear-gradient(top,#F8F8F8 0,#fafafa 100%);
  background-image: linear-gradient(to bottom,#F8F8F8 0,#fafafa 100%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff8f8f8', endColorstr='#ffececec', GradientType=0); */
}

.table > thead > tr > th {
  border-color: #e9ecef;
  font-weight: 700;
  border-right-color: transparent;
}

.table > thead > tr > th .ace-icon:first-child {
  margin-right: 2px;
}

.table > thead > tr > th:first-child {
  border-left-color: #f1f1f1;
}

.table > thead > tr > th:last-child {
  border-right-color: #f1f1f1;
}

.table.table-bordered > thead > tr > th {
  vertical-align: middle;
}

td.center,
th.center {
  text-align: center;
}

td .lbl,
th .lbl {
  margin-bottom: 0;
}

td .lbl:only-child,
th .lbl:only-child {
  vertical-align: top;
}

.table-header {
  background-color: #307ecc;
  color: #fff;
  font-size: 14px;
  line-height: 38px;
  padding-left: 12px;
  margin-bottom: 1px;
}

.table-header .close {
  margin-right: 8px;
  margin-top: 0;
  opacity: 0.45;
  filter: alpha(opacity=45);
}

.table-header .close:hover {
  opacity: 0.75;
  filter: alpha(opacity=75);
}

th.detail-col {
  width: 48px;
  text-align: center;
}

tr.detail-row {
  display: none;
}

tr.detail-row.open {
  display: block;
  display: table-row;
}

tr.detail-row > td {
  background-color: #f1f6f8;
  border-top: 3px solid #d1e1ea !important;
}

.table-detail {
  background-color: #fff;
  border: 1px solid #dcebf7;
  width: 100%;
  padding: 12px;
}

.table-detail td > .profile-user-info {
  width: 100%;
}
.clearfix {
  line-height: 40px;
  display: flex;
}
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
.el-icon-arrow-down {
  font-size: 12px;
}
.install-title {
  display: flex;
  align-items: center;
  line-height: 30px;
  padding-left: 20px;
  color: #fff;
  background-color: #d7dae2;
  justify-content: flex-start;
  margin-bottom: 10px;
}
.delete {
  width: 10px;
  height: 10px;
  position: relative;
  top: -10px;
  cursor: pointer;
}
::v-deep .el-upload-list {
  width: 100px;
  display: flex;
  margin: 10px 10px;
}
::v-deep .el-upload-list > li {
  margin: 10px 10px;
}
::v-deep.el-upload-list__item {
  margin: 10px 10px;
}
::v-deep.el-upload-list--picture .el-upload-list__item {
  margin: 10px 10px !important;
}
.user-info-head {
  position: relative;
  display: inline-block;
  height: 120px;
}

::v-deep.avatar-upload-preview {
  width: 400px;
  border-radius: 0%;
  height: 400px;
  > img {
    transform: translateX(0);
  }
}
.user-info-head:hover:after {
  content: "+";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  color: #eee;
  background: rgba(0, 0, 0, 0.5);
  font-size: 24px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: pointer;
  line-height: 110px;
  border-radius: 50%;
}

/deep/.upload-dragger {
  background-color: #fff;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cropper-wrapper {
  //height: calc(100vh - 50px);
  .pre-box {
    button {
      width: 100px;
      margin-top: 15px;
    }
  }
}

/deep/.el-dialog {
  position: relative;
  margin: 0 auto 50px;
  background: #fff;
  border-radius: 2px;
  box-sizing: border-box;
  width: 80%;
}

.crop-dialog {
  .cropper-content {
    padding: 0 40px;

    .cropper {
      width: 900px;
      height: 900px;
    }
  }

  .action-box {
    padding: 25px 40px 0 40px;
    display: flex;
    justify-content: center;

    button {
      width: 80px;
      margin-right: 15px;
    }
  }

  .dialog-footer {
    button {
      width: 100px;
    }
  }
}

.green {
  color: green;
}
.red {
  color: orangered;
}
</style>
